﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using RearLivestock.Common.Domains.hq;
using RearLivestock.Common.Dtos;
using RearLivestock.RBAC.Api.Application.hqApplication.Commands.Ablactationss;
using RearLivestock.RBAC.Api.Application.hqApplication.Commands.Clientss;
using RearLivestock.RBAC.Api.Application.hqApplication.Commands.Saless;

namespace RearLivestock.RBAC.Api.Controllers.hq
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ClientController : ControllerBase
    {
        private readonly IMediator imediator;

        public ClientController(IMediator imediator)
        {
            this.imediator = imediator;
        }
        /// <summary>
        /// 客户添加
        /// </summary>
        /// <param name="cmd"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> addClien(AddClienComand cmd)
        {
            return await imediator.Send(cmd);
        }
        /// <summary>
        /// 客户显示
        /// </summary>
        /// <param name="cmd"></param>
        /// <returns></returns>

        [HttpPost]
        public async Task<Result<PageResultDto<Clients>>>showClientComand(ShowClientComand cmd)
        {
            return await imediator.Send(cmd);
        }


    }
}
